﻿<%@ Page Title="" Language="C#" MasterPageFile="~/administrator/backend.Master" AutoEventWireup="true" CodeBehind="lecture-chapter-add.aspx.cs" Inherits="VQWEB.administrator.english.lectures.lecture_chapter_add" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content_backend" runat="server">
    <form id="frm_lecturechapter" runat="server" role="form">
    <asp:FormView ID="frmLectureChapter" runat="server" RenderOuterTable="false" 
        onitemcreated="frmLectureChapter_ItemCreated">
        <EditItemTemplate>
         <div class="form-group">
                <label>
                    Table</label>
             <asp:Literal ID="ltrTable" runat="server" />
            </div>
            <div class="form-group">
                <label>
                    Tieu de chuong</label>
                <input class="form-control" name="chapter_lecture_title" type="text" value='<%# Eval("chapter_lecture_title") %>' />
            </div>
            <div class="form-group">
                <label>
                    Noi dung chuong</label>
                <textarea class="form-control" name="chapter_lecture_content" rows="3"><%# Eval("chapter_lecture_content") %></textarea>
            </div>
            <div class="checkbox">
                <label>
                    <input <%# Eval("chapter_lecture_active") !=null && (bool)(Eval("chapter_lecture_active")) ? " checked='checked'" : null %>=""
                        name="chapter_lecture_active" type="checkbox" value="True" />
                    Active
                </label>
            </div>
            <input name="chapter_lecture_id" type="hidden" value='<%# (Eval("chapter_lecture_id") != null) ? Eval("chapter_lecture_id") : "0" %>' />
        </EditItemTemplate>
    </asp:FormView>
    </form>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Script_backend" runat="server">
    <script type="text/javascript">
        ShowToolBar("edit");
        var url_ashx = "/admin/english/lecture/handler";
        $("#btnCancel").live("click", function () {
            window.location = "/admin/english/lecture/chapter/list";
        });
        $("#btnSave").live("click", function () {
            var arr = $("#frm_lecturechapter").serializeObject();
            $.post(url_ashx, { add_lecture_chapter: window.escape(arr) }, function (data) {
                alert(data);
                window.location = "/admin/english/lecture/chapter/list";
            });
        });
    </script>
</asp:Content>
